"""
Examples of TTY command presets for a variety of GNSS and related devices

Copy those required to your *.json configuration file and invoke them
via the TTY Command dialog.

Created on 30 May 2025

:author: semuadmin
:copyright: 2025 SEMU Consulting
:license: BSD 3-Clause
"""

# ******************************************
# Septentrio Mosaic X5 Receiver
#
# Send an 'Initialise Command Mode' string
# before sending further commands.
#
# NOT NECESSARILY AN EXHAUSTIVE LIST
# Full details in https://www.septentrio.com/resources/mosaic-X5/mosaic-X5+Firmware+v4.14.10.1+Reference+Guide.pdf
# ******************************************
{
    'ttypresets_l': [
        "Initialise Command Mode; SSSSSSSSSS", 
        "List Antenna Info; lai, Overview",
        "List Antenna Info; lai, 'AERAT2775_159 SPKE'",
        "List Command Help; help, Overview",
        "List Command Help; help, getReceiverCapabilities",
        "List Command Help; help, grc",
        "Set Marker Parameters; smp, TestMarker",
        "List Config File; lcf, Current",
        "Execute Copy Config File; eccf, Current, Boot",
        "Execute Copy Config File; eccf, User1, Current",
        "Set Ethernet Mode; seth, on",
        "Execute FTP Upgrade; efup, myftp.com, /tst.suf, user, password",
        "Set GPIO Functionality; sgpf, GP2, Output, , LevelHigh",
        "List Internal File; lif, Permissions",
        "Set LED Mode; slm, DIFFCORLED",
        "List MIB Description; lmd, Overview",
        "List MIB Description; lmd, grc",
        "Get Receiver Capabilities; grc",
        "Get Receiver Interface; gri",
        "Execute Registered Applications; era, com1, MyApp",
        "Execute Reset Receiver; erst, soft, none",
        "Set USB Internet Access; suia, on",
        "Execute Power Mode; epwm, Standby",
        "List Current User; lcu",
        "login; login,admin, admin",
        "List Current User; lcu",
        "Set Default Access Level; sdal, User, none, User, none, User",
        "Login; login, admin, admin",
        "Set SBF Output; sso, Stream1, COM1, MeasEpoch, sec1",
        "Set SBF Output; sso, Stream1, COM1, PVTCartesian, sec1",
        "Logout; logout",
        "Set User Access Level; sual, User3, Mildred, mypwd, Viewer, AAAAE2VjZH ...",
        "Set Calibration Common Delay; scco, 65.4",
        "Set Calibration Signal Delay; scsi, GPSL5+GALE5a, -2.56",
        "Set Channel Allocation; sca, Ch05, G01",
        "Get Channel Allocation; gca, Ch05",
        "Set CN0 Mask; scm, GEOL1, 30",
        "Get CN0 Mask; gcm, GEOL1",
        "Set Multipath Mitigation; smm, on, off",
        "Get Multipath Mitigation; gmm",
        "Set Satellite Tracking; sst, GPS",
        "Set Satellite Tracking; sst, +SBAS",
        "Set Satellite Tracking; sst, -S120",
        "Set Signal Tracking; snt, GPSL1CA+GEOL1",
        "Get Signal Tracking; gnt",
        "Set Smoothing Interval; ssi, GPSL1CA, 300",
        "Get Smoothing Interval; gsi, GPSL1CA",
        "Set Tracking Loop Parameters; stlp, GPSL1CA, 0.20, 12, , , off",
        "Set AGC Mode; sam, all, manual, 30",
        "Set BB Sampling Mode; sbbs, BeforeIM",
        "Set Notch Filtering; snf, Notch1, manual, 1227.0, 30",
        "Set WBI Mitigation; swbi, on",
        "Set Antenna Offset; sao, Main, 0.1, 0.0, 1.3, 'AERAT2775_159 SPKE', 5684, 0",
        "Set Differential Correction Max Age; sdca, 10",
        "Set Differential Correction Usage; sdcu, LowLatency, 5.0, manual, 1011, off, 1, 10000",
        "Set Elevation Mask; sem, PVT, 15",
        "Set Geoid Undulation; sgu, manual, 25.3",
        "Get Geoid Undulation; ggu",
        "Set Health Mask; shm, Tracking, off",
        "Get Health Mask; ghm",
        "Set Ionosphere Model; sim, off",
        "Get Ionosphere Model; gim",
        "Set Magnetic Variance; smv, manual, 1.1",
        "Get Magnetic Variance; gmv",
        "Set Network RTK Config; snrc, VRS",
        "Set PVT Mode; spm, Rover, StandAlone+RTK",
        "Set Static Pos Geodetic; sspg, Geodetic1, 50.5209, 4.4245, 113.3",
        "Set PVT Mode; spm, Static, , Geodetic1",
        "Set RAIM Levels; srl, on, -4, -4, -6",
        "Set RAIM Levels; srl, off",
        "Set Receiver Dynamics; srd, High, Automotive",
        "Execute Reset Nav Filter; ernf, PVT",
        "Set Satellite Usage; ssu, GPS",
        "Set Satellite Usage; ssu, +SBAS",
        "Set Satellite Usage; ssu, -S120",
        "Set SBAS Corrections; ssbc, S122, Test",
        "Set Signal Usage; snu, GPSL1CA, GPSL1CA",
        "Set Static Pos Cartesian; sspc, Cartesian1, 4019952.028, 331452.954, 4924307.458",
        "Set PVT Mode; spm, Static, , Cartesian1",
        "Set Static Pos Geodetic; sspg, Geodetic1, 50.86696443, 4.71347657, 114.880",
        "Set PVT Mode; spm, Static, , Geodetic1",
        "Set Troposphere Model; stm, MOPS, MOPS",
        "Get Troposphere Model; gtm",
        "Set Troposphere Parameters; stp, 25, 1013, 60",
        "List Gal OSNMA Public Keys; lopk",
        "Set Galileo OSNMA Public Keys; sopk, Key2,",
        "Set Galileo OSNMA Usage; sou, strict",
        "Set Galileo OSNMA Usage; sou, loose,",
        "Set Antenna Location; sal, Base, manual, 0, -1, 0.1",
        "Set Attitude Offset; sto, 93.2, -0.4",
        "Set GNSS Attitude; sga, MovingBase",
        "Set Geodetic Datum; sgd, ETRS89",
        "Set User Datum; sud, User1, 52.1, 49.3, -58.5, 0.891, 5.390, -8.712,",
        "Set User Datum Vel; sudv, User1, 0.1, 0.1, -1.8, 0.081, 0.49, -0.792, 0.08,",
        "Set User Ellipsoid; sue, User1, 6378388, 297",
        "Set ENH Transform Horizontal; smth, lt1, 10.904, 10.904, 156.341, 1.3, 1.34, 1.34, 1.34,",
        "Set ENH Transform Vertical; smtv, lt1, 10.904, 156.341, 1.3, 1.34, 1.34",
        "Set Local Coord Operation; slco, NONE, lt1",
        "List Local Coord Operations; llc, Overview",
        "Set Clock Sync Threshold; scst, msec1, off",
        "Set Event Parameters; sep, EventA, High2Low, 10",
        "Set Ntp Client; snc, on, pool.ntp.org",
        "Set NTP Server; sntp, on",
        "Set PPS Parameters; spps, sec1, Low2High, 23.40, GPS, 60, 0.1",
        "Set PTP Server; sptp, on",
        "Set Time Sync Source; stss, EventB",
        "Set Timing System; sts, GPS",
        "Set Marker Parameters; smp, Test, 356, GEODETIC, TST1, 0, 0, BEL",
        "Set Observer Comment; soc, 'Data taken with choke ring antenna'",
        "Get Observer Comment; goc",
        "Set Observer Parameters; sop, TestObserver, TestAgency",
        "Get Observer Parameters; gop",
        "Set Check Internet Availability; scia, on",
        "Set COM Settings; scs, COM1, baud19200, bits8, No, bit1, RTS|CTS",
        "Set Cross Domain Web Access; scda, on",
        "Set Daisy Chain Mode; sdcm, DC1, ASCII",
        "Set Data In Out; sdio, COM1, CMD",
        "Set Data In Out; sdio, COM2, DC1, DC2",
        "Set Data In Out; sdio, COM3, DC2, DC1",
        "Set Dynamic DNS; sdds, dyndns.org, Bart, MyPwd, rx1.dyndns-free.com, auto",
        "Execute Echo Message; eecm, COM2, 'A:Hello world!', none",
        "Execute Echo Message; eecm, COM2, 'H:48 65 6C 6C 6F 20 77 6F 72 6C 64 21', none",
        "Set Https Settings; shs, HTTP",
        "Set IP Filtering; sipf, on, 192.168.0.7 192.168.2.0/24",
        "Set IP Keep Alive; sipk, on, 20, 20, 20",
        "Set IP Port Settings; sipp, 12345, 21",
        "Set IP Receive Settings; sirs, IPR1, 28785, TCP2Way, 192.168.10.5",
        "Set IP Server Settings; siss, IPS1, 28785, UDP, 255.255.255.255",
        "Set IP Settings; sips, Static, 192.168.1.123, 255.255.252.0, 192.168.1.255,",
        "Set Periodic Echo; spe, COM2, 'A:Hello!''CR''LF', sec60",
        "Set Periodic Echo; spe, COM2, 'H:48 65 6C 6C 6F 21 0D 0A', sec60",
        "Set Periodic Echo; spe, COM2, 'A:Hello!''CR''LF', once",
        "Execute Copy Config File; eccf, Current, Boot",
        "Set Point To Point; sp2p, P2PP1, Off, COM1, 255.255.255.255, 255.255.255.255,",
        "Set Port Firewall; spfw, Ethernet, PortList, '21 80 28784'",
        "Set NTRIP Caster Mount Points; snmp, MP1, on, MyMP, Yes, MyUser, MyPwd, basic",
        "Set NTRIP Caster MP Format; smpf, MP1, manual, RAW''CMNMEA, 'SBF (1s)''CM NMEA (5s)'",
        "Set NTRIP Caster Settings; sncs, on, 2101, default, 2102",
        "Set NTRIP Caster Users; sncu, User1, MyUser, MyPwd, all, 1",
        "Set NTRIP Settings; snts, NTR1, Client, ntrip.com, 2101, USER, PWD, MP1, v2,",
        "List NTRIP Source Table; lnst, ntripcaster",
        "Set NTRIP Tls Settings; sntt, NTR1, on, ''",
        "Set NTRIP Tls Settings; sntt, NTR1, on, Aa:Bb:56:78:90:12: ... 78:90:12:34",
        "Set NTRIP Tls Settings; sntt, NTR1, on, 'Aa Bb 56 78 90 12 ... 78 90 12 34'",
        "Set NTRIP Tls Settings; sntt, NTR1, on, AaBb56789012 ... 78901234",
        "Execute NMEA Once; enoc, COM1, GGA",
        "Set NMEA Output; sno, Stream1, COM1, GGA, sec1",
        "Set NMEA Output; sno, Stream2, COM1, RMC, msec100",
        "Get NMEA Output; gno",
        "Set NMEA Precision; snp, 2, Mode2, off, 0.05",
        "Set NMEA Talker ID; snti, GP",
        "Set NMEA Version; snv, v4x",
        "Set Meas3 Max Ref Interval; smrf, OnlyRef",
        "Set SBF Groups; ssgp, Group1, MeasEpoch+PVTCartesian+DOP",
        "Set SBF Output; sso, Stream1, COM1, Group1, sec1",
        "Execute SBF Once; esoc, COM1, MeasEpoch",
        "Set SBF Output; sso, Stream1, COM1, MeasEpoch, msec100",
        "Set SBF Output; sso, Stream2, COM1, PVTGeodetic, sec1",
        "Set RTCMv2 Compatibility; sr2c, , Tb",
        "Set RTCMv2 Ephemeris Holdoff; sr2h, 60, 0",
        "Set RTCMv2 Formatting; sr2f, 345",
        "Get RTCMv2 Formatting; gr2f",
        "Set RTCMv2 Interval; sr2i, RTCM22, 15",
        "Get RTCMv2 Interval; gr2i",
        "Set RTCMv2 Interval Obs; sr2b, RTCM20|21, 2",
        "Get RTCMv2 Interval Obs; gr2b",
        "Set RTCMv2 Message16; sr2m, Hello",
        "Set RTCMv2 Output; sr2o, COM2, RTCM16",
        "Set Data In Out; sdio, COM2, , RTCMv2",
        "Set RTCMv2 Output; sr2o, COM2, RTCM3+RTCM18|19+RTCM22",
        "Set Data In Out; sdio, COM2, , RTCMv2",
        "Set RTCMv2 Usage; sr2u, RTCM1+RTCM3",
        "Set Differential Correction Usage; sdcu, , , manual, 1011",
        "Set RTCMv3 CRS Transform; sr3t, manual, '4258'",
        "Set RTCMv3 Interval; sr3i, RTCM1001|2, 10",
        "Set RTCMv3 Delay; sr3d, 2",
        "Set RTCMv3 Formatting; sr3f, 345,",
        "Set RTCMv3 Interval; sr3i, RTCM1001|2, 2",
        "Set RTCMv3 Message1029; sr3m, Hello",
        "Set RTCMv3 Output; sr3o, COM2, RTCM1029",
        "Set Data In Out; sdio, COM2, , RTCMv3",
        "Set RTCMv3 Output; sr3o, COM2, RTCM1001+RTCM1002+RTCM1005+RTCM1006",
        "Set Data In Out; sdio, COM2, , RTCMv3",
        "Set RTCMv3 Usage; sr3u, RTCM1001+RTCM1002",
        "Set Differential Correction Usage; sdcu, , , manual, 1011",
        "Set CMRv2 Formatting; sc2f, 12",
        "Get CMRv2 Formatting; gc2f",
        "Set CMRv2 Interval; sc2i, CMR0, 2",
        "Get CMRv2 Interval; gc2i",
        "Set CMRv2 Message2; sc2m, Hello",
        "Set CMRv2 Output; sc2o, COM2, CMR2",
        "Set Data In Out; sdio, COM2, , CMRv2",
        "Set CMRv2 Output; sc2o, COM2, CMR0",
        "Set Data In Out; sdio, COM2, , CMRv2",
        "Set CMRv2 Usage; sc2u, CMR0",
        "Set Differential Correction Usage; sdcu, , , manual, 12",
        "Set Disk Full Action; sdfa, DSK1, StopLogging",
        "Get Disk Full Action; gdfa",
        "List Disk Info; ldi, DSK1",
        "Set File Naming; sfn, DSK1, FileName, mytest",
        "Set Global File Naming Options; sfno, on",
        "Execute Manage Disk; emd, DSK1, Format",
        "List Recorded File; lrf, DSK1, log.sbf",
        "List Recorded File; lrf, DSK1, log.sbf",
        "Execute Remove File; erf, DSK1, 03298/ATRX2980.03_",
        "Execute Remove File; erf, DSK1, all",
        "Set RINEX Logging; srxl, DSK1, hour24, sec30, GPSL1CA",
        "Set UMSD On Connect; suoc, off",
        "Set FTP Push RINEX; sfpr, ftp.mydomain.com, mydata/'Y'm'd, myname, mypwd",
        "Set FTP Push SBF; sfps, ftp.mydomain.com, mydata/'Y'm'd, myname, mypwd",
        "Execute FTP Push Test; efpt, myftp.com, mydata/'Y'm'd, myname, mypwd",
        "List L Band Beams; llbb",
        "Set L Band Beams; slbb, User1, 1537460000, baud1200, 25East, E, Enabled",
        "Set L Band Custom Service ID; slcs, A5A5, 0101, on",
        "Set L Band NTRIP Delivery; slnd, NTR1",
        "Set L Band Select Mode; slsm, manual, LBAS2, User1, User2",
    ],
}

# ******************************************
# Feyman IM19 IMU with Tilt Compensation
#
# Full details in http://www.feymani.com/en/uploadfile/2023/1008/20231008072903360.pdf
# ******************************************
{
    'ttypresets_l': [
        'Tilt Survey Setup; AT+LOAD_DEFAULT; AT+GNSS_PORT=PHYSICAL_UART2; AT+NASC_OUTPUT=UART1,ON; AT+LEVER_ARM2=0.0057,-0.0732,-0.0645; AT+CLUB_VECTOR=0,0,1.865; AT+INSTALL_ANGLE=0,180,0; AT+GNSS_CARD=OEM; AT+WORK_MODE=408; AT+CORRECT_HOLDER=ENABLE; AT+SET_PPS_EDGE=RISING; AT+AHRS=ENABLE; AT+MAG_AUTO_SAVE=ENABLE; AT+SAVE_ALL',
        'System reset CONFIRM; AT+SYSTEM_RESET',
        'Save the parameters CONFIRM AT+SAVE_ALL',
        'Update module firmware, see attachment for protocols; AT+UPDATE_APP',
        'Update Bootloader, see attachment for protocols; AT+UPDATE_BOOT',
        'Set the GNSS RTK receiver type; AT+GNSS_CARD=OEM',
        'Read parameters (SYSTEM/ALL); AT+READ_PARA=SYSTEM/ALL',
        'Loading default parameters; AT+LOAD_DEFAULT',
        'Installation angle estimation in tilt measurement applications; AT+AUTO_FIX=ENABLE/DISABLE',
        'Set the RTK pole vector to map the position to the end of the RTK pole; AT+CLUB_VECTOR=X,Y,Z',
        'Binary NAVI positioning output; AT+NAVI_OUTPUT=UART1,ON/OFF',
        'Ascii type NAVI positioning output; AT+NASC_OUTPUT=UART1,ON/OFF',
        'MEMS raw output; AT+MEMS_OUTPUT=UART1,ON/OFF',
        'GNSS raw output; AT+GNSS_OUTPUT=UART1,ON/OFF',
        'Set the lever arm; AT+LEVER_ARM=X,Y,Z',
        'Query whether time is synchronized between MEMS and GNSS; AT+CHECK_SYNC',
        'High-rate mode setting; AT+HIGH_RATE=ENABLE/DISABLE',
        'Module activation; AT+ACTIVATE_KEY=KEY',
        'Set the initial alignment speed threshold; AT+ALIGN_VEL=1.0',
        'Query the Firmware version; AT+VERSION',
        'Set GNSS serial port; AT+GNSS_PORT=PHYSICAL_UART2',
        'Set the module working mode; AT+WORK_MODE=X',
        'Set the module installation angle; AT+INSTALL_ANGLE=X,Y,Z',
        'Query the serial port number; AT+THIS_PORT',
        'Causes the filter to enter or exit stop mode; AT+FILTER_STOP=ENABLE/DISABLE',
        'UART n enters or exits the loopback mode; AT+LOOP_BACK=UARTn/NONE',
        'Filter Reset; AT+FILTER_RESET',
        'Check firmware CRC, N=firmware size; AT+CHECK_CRC=N',
        'Turn on or off RTK pole length compensation; AT+CORRECT_HOLDER=ENABLE/DISABLE',
        'Disable the output of all messages over the serial port x; AT+DISABLE_OUTPUT=UARTx',
        'Factory calibration command; AT+CALIBRATE_MODE2=STEP1/STEP2',
    ],
}
